
<h1 style='text-align:center'>修改密码</h1>
<!--编辑或添加商户信息-->
<div id='Store_Main_SubArea' >
	<div style='margin:10px auto;width:250px;display:flex'>
		<div style='width:100px;text-align:right'>原密码：</div>
		<div style='flex:1'><input type='password' id='controlStoreUpdatePwdP1' style='width:90%' /></div>
	</div>
	<div style='margin:10px auto;width:250px;display:flex'>
		<div style='width:100px;text-align:right'>新密码：</div>
		<div style='flex:1'><input type='password' id='controlStoreUpdatePwdP2' style='width:90%' /></div>
	</div>
	<div style='margin:10px auto;width:250px;display:flex'>
		<div style='width:100px;text-align:right'>新密码：</div>
		<div style='flex:1'><input type='password' id='controlStoreUpdatePwdP3' style='width:90%' /></div>
	</div>
	

	<div style='text-align:center;margin:20px auto'>
		<button id='controlStoreUpdatePwdP1SubBtn'>提交</button>
		<button onclick='_updatePwdBack()'>返回</button>
	</div>
</div>



<script>
	$('#controlStoreUpdatePwdP1SubBtn').click(function(){
		Notice('操作处理中...');
		var p1 = ChangeChar($('#controlStoreUpdatePwdP1').val().trim());
		var p2 = ChangeChar($('#controlStoreUpdatePwdP2').val().trim());
		var p3 = ChangeChar($('#controlStoreUpdatePwdP3').val().trim());
		if(!p1 || !p2){
			A('密码项不得为空！');
			return;
		}
		if(p2 != p3){
			A('两次新密码不一致！');return;
		}
		var data = {
			type:'updateStorePwd',
			p1:p1,
			p2:p2
		};
		AjaxStore(data,function(res){
			Notice('');
			var tmp = _checkJsonFormat(res); //检测JSON格式
			if(tmp.stat == 'ok'){
				A('密码修改成功！');
				$('#controlStoreUpdatePwdP1,#controlStoreUpdatePwdP2,#controlStoreUpdatePwdP3').val('');
				_updatePwdBack();
			}else{
				A('原密码不正确！');
			}
		});

	});

	//返回
	function _updatePwdBack(){
		$('.ContentItem').hide();
		$('#controlStore').show();
	}
</script>